package org.vergil.utils;

import java.util.UUID;


/**
 * UUID 方法类
 * @author: yuantao
 * @Date: 2018/4/22
 * @since 1.0.0
 */
public class UUIDUtils {

    public final static String CHAR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    public final static String CHAR_NUM = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

    /**
     * 生成UUID
     * 格式如:364c1588-b86c-4fa4-9254-0968f01d50a9
     *
     * @return
     */
    public static UUID getUUID() {
        return UUID.randomUUID();
    }

    /**
     * 生成UUID
     * 格式如:9f7c5203b0c3408087d9bfc61696f4f6
     *
     * @return string
     * @since 8
     */
    public static String getUUIDStr() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

}
